<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
	<head>
		<title>register</title>
		<script type="text/javascript">
			function ddd(){
				if(document.getElementById("username").value==''){
					alert('Username is requried');
					return false;
				}
		            return true;
			}
			
			function checkUserName(ssn){
			if(ssn.length<3 || ssn.length>8){
			document.getElementById("usernameErr").innerHTML="<font color='red'>请输入正确的用户名，用户名长度为3-8位！</font>";
			form.username.focus()
			return false;
			}
			document.getElementById("usernameErr").innerHTML="";
			}
			
			
		</script>		
	</head>
	<body>
		<h2>Register</h2>
		<s:form action="register" namespace="/" >
			<s:textfield name="user.username" label="Username" id="username" onblur="checkUserName(this.value.toLowerCase())"/>
			<span id="usernameErr"></span>
			
			<s:password name="user.password" label="Password"/>
			<s:password name="confirmPassword" label="Confirm Password"/>
			<s:textfield name="user.email" label="Email"/>
			<s:submit value="Submit Register"></s:submit>
		</s:form>		
	</body>
</html>



